package net.xdclass.strategy;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author zhaowei
 * @Description TODO
 * @Remark 有问题直接联系我
 * @Version 1.0
 **/
public class ShardingTableConfig {

    /**
     * 存储数据表的位置编号
     */
    public static final List<String> tableSuffixList=new ArrayList<>();

    public static Random random =new Random();

    static {
        tableSuffixList.add("0");
        tableSuffixList.add("1");
    }


    /**
     * 获取随机的后缀
     * @return
     */
    public static String getRandomTableSuffix(){
        int nextInt = random.nextInt(tableSuffixList.size());
        return tableSuffixList.get(nextInt);
    }

}
